Skip to content

Implement constraints TuRBO in optimizers#191

Merged
skbarber merged 7 commits intomasterfrom
implement-constraints-TuRBO-in-optimizers
Aug 22, 2025
Merged

Implement constraints TuRBO in optimizers#191
skbarber merged 7 commits intomasterfrom
implement-constraints-TuRBO-in-optimizers

Conversation

@skbarber
Copy link
Copy Markdown
Collaborator

this PR adds a tested implementation of a turbo controller for bayes optimization. New named generator example.

Also: new method in ScanExecutor to create threads for executing set commands during a scan. Now, each device has it's own thread and set commands can happen in parallel. Significant speed up for multi device optimization scans.

Some initial work at cleaning up how values from ImageAnalysis are tracked an used in optimizers. Still more to do on this front

Introduced new TuRBO-based generator options in PREDEFINED_GENERATORS and implemented the _make_bayes_turbo helper for flexible trust region configuration. This enables more advanced Bayesian optimization strategies with customizable trust region parameters.
Introduces constraints on total_counts and emittance_proxy in the optimizer config and updates the HiResMagCam evaluator to extract, cache, and return these metrics alongside the objective value. Also changes the generator name in the config to bayes_turbo_HTU_e_beam_brightness.
Changed the number of initialization steps from 3 to 1 in the ScanStepExecutor class to streamline the initialization process before step generation.
Introduced move_devices_parallel_by_device to set device variables in parallel using threads, improving scan step execution speed. The method groups variables by device, sets them with retries and tolerance checks, and replaces the previous sequential move_devices call in execute_step.
Deleted the unused variable 'd' from the _make_bayes_turbo function in generator_factory.py to clean up the code.
@skbarber skbarber merged commit 441ad59 into master Aug 22, 2025
2 checks passed
@skbarber skbarber deleted the implement-constraints-TuRBO-in-optimizers branch August 22, 2025 20:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant